// Copyright (c) 2025-present AutoStories Contributors.
// All contributors are listed in CONTRIBUTORS.yaml at monorepo root.
//
// AutoStories is licensed under Mulan PSL v2.
// You can use this software according to the terms
// and conditions of the Mulan PSL v2.
// You may obtain a copy of Mulan PSL v2 at:
//
//   http://license.coscl.org.cn/MulanPSL2
//
// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS,
// WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
// See the Mulan PSL v2 for more details.
//
// 上述开源协议注释乃程序自动生成，请勿编辑
// === Auto generated, DO NOT EDIT ABOVE ===

import 'dart:io';

import 'package:auto_stories_dev/script.dart';
import 'package:path/path.dart';

Future<void> main(List<String> arguments) async {
  build();
}

void build() {
  final root = Directory.current;
  const comment = '上述开源协议注释乃程序自动生成，请勿编辑';
  final generator = LicenseNotationGenerator.from(root, comment: comment)
    ..updateFile(File(join(root.path, 'build.dart')));

  final filenames = ['LICENSE'];
  DartPackage.resolve()
    ..updateLicenseNotation(generator)
    ..syncAssets(filenames);

  DartPackage.resolve(path: 'flutter')
    ..updateLicenseNotation(generator)
    ..syncAssetsFrom(root, filenames);
}
